package com.cy.jt;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

@SpringBootTest
public class Bcrypt {
    @Test
    void testEncode(){
        String password = "yunkai";
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String newPwd = encoder.encode(password);
        System.out.println(newPwd);
        System.out.println(newPwd.length());
        System.out.println(encoder.matches(password, newPwd));;
    }
}
